function* helloWorldGenerator() {
    yield 'hello'
    yield 'world'
    return 'ending'
}

var gen = helloWorldGenerator()
console.log('gen.next', gen.next())
console.log('gen.next', gen.next())
console.log('gen.next', gen.next())